package com.fuss.activitytest

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_second.*
import kotlinx.android.synthetic.main.title.*

class SecondActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_second)

        supportActionBar?.hide()

        title_text.text = "SecondActivity"
        call_btn.setOnClickListener {

            val intent = Intent(Intent.ACTION_DIAL)
            intent.data = Uri.parse("tel:10086")
            startActivity(intent)
        }

        back_btn.setOnClickListener {

            finish()
        }

        edit_btn.setOnClickListener {

            Toast.makeText(this, "You clicked edit_btn!", Toast.LENGTH_SHORT).show()
        }
    }
}
